<?php
require_once 'dbms_university_courses_mvc/Model/model_require_once.php';

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>

<!-- import the style scripts -->
<link href="css_include/palette_112.css" media="screen" rel="stylesheet"
	type="text/css"
/>
<link href="css_include/global_112.css" media="screen" rel="stylesheet"
	type="text/css"
/>
<link href="css_include/niftyCorners.css" rel="stylesheet"
	type="text/css"
/>
<link href="css_include/niftyPrint.css" media="print" rel="stylesheet"
	type="text/css"
/>

<script type="text/javascript" src="js_include/niftycube.js"></script>
<?php
$theme = "gator";
require_once 'dbms_university_courses_mvc/View/Includes/view_require_once.php';
?>
<script type="text/javascript" src="js_include/niftyCornerCalls.js"></script>
<script type="text/javascript" src="js_include/index_functions.js"></script>
<script type="text/javascript">
<?php
require_once 'dbms_university_courses_mvc/Model/dbms_university_courses_javascript_classes.min.js';
?>
var templatePages = new Array;
<?php
$pages = array ();
if (isset ( $_SESSION ['profile_id'] )) {
	/* @var $profile Profile */
	$profile = Profile::constructFrom_profile_id ( $_SESSION ['profile_id'] );
	$pages = Page::getPages_by_user_type_id ( $profile->get_user_type_id () );
	?>
	if(!location.hash){
		location.hash = <?php
	echo $pages [0]->get_page_id ();
	?>;
	}
	<?php
	//print the array of pages into javascript
	/* @var $page Page*/
	foreach ( $pages as $page ) {
		?>
	templatePages.push('<?php
		echo $page->get_page_id ();
		?>');
	
	<?php
	}
	?>
	templatePages.push("Logout");
<?php
}
?>


</script>

<title>University Course Management System</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!--[if lte IE 6]>
            <style type="text/css">
            html, body {
            height: 100%;
            overflow: auto;
            }
            div.taskcount {
            position: absolute;
            margin-right: 15px
            }
            </style>
        <![endif]-->
</head>

<body class="cp0">
<div class="cp9">
<div id="header">
<div id="globalmenu" style="display: none;"><a href="feedback">feedback</a>
| <a href="schedule">settings</a> | <a href="logout">logout</a></div>
<span class="vht_logo">University<span class="vht_logo_bold_blue">CourseManagement</span>System</span>
</div>
</div>
<div id="centerbody">
<div id="stepsmenu">
<?php

if (isset ( $_SESSION ['profile_id'] )) {
	?>
<ul id="stepsnav">
<?php
	$brcumb_index = 0;
	//print the same number of breadcrumbs as there are pages
	foreach ( $pages as $page ) {
		/* @var $page Page */
		$page = Page::constructFrom_page_id ( $page->get_page_id () );
		?>
	<li class="breadcrumb"
		id="bcrumbbubble_<?php
		echo $brcumb_index;
		?>"
	><a id="bcrumb_<?php
		echo $brcumb_index;
		?>"
		href="#<?php
		echo $page->get_page_id ();
		?>"
		title="<?php
		echo $page->get_description ();
		?>"
	><?php
		echo $page->get_page_title_text ();
		?></a></li>
<?php
		$brcumb_index ++;
	}
	$complete_page_index = count ( $pages ) + 1;
	?>

<li class="breadcrumb"
		id="bcrumbbubble_<?php
	echo $complete_page_index;
	?>"
	><a id="bcrumb_<?php
	echo $complete_page_index;
	?>" href="#logout">Logout</a></li>

</ul>
	<?php
}
?>
</div>

<div id="submenu" class="cp26 topBig">
<div class="subtext">
<div id="loading"><br> &nbsp;&nbsp;&nbsp;&nbsp; 


<img src="images/loadingAnimation.gif" alt="Loading animation" />Loading...</div>
</div>
<br>


<div class="spacer"></div>
</div>
<div class="cp6">

<div id="message" style="display: none;"></div>
<div id="content"></div>
</div>

<div style="display: none;" class="taskcount cp32 ui-corner-all"><span>Page<br />
</span>
<h1 id="task_value"></h1>
</div>

<div id="submenu" class="cp26 bottombiground">
<div class="subtext"></div>
<br>


<div class="spacer"></div>
</div>

<div id="footer" style="display: none;"><a
	href="mailto:brossen@cise.ufl.edu"
>Contact</a> | <a href="http://brent.lizandbrent.com">Brent Rossen</a></div>
<div id="dialogBox" style="display: none;"></div>
<script type="text/javascript">
function openDialog(url)
{
	var myData = new Object; 
	$.ajax({
		url: url,
		type: 'GET',
		data: myData, 
		dataType: 'html',
		error: errorFunction,
		success: function(html){
			$("#dialogBox").html(html);
			$("#dialogBox").dialog("open");
		}
	});	
}

	$(document).ready(function(){	
		//init dialog
		$("#dialogBox").dialog({
			autoOpen: false,
			position: "top",
			bgiframe: true,
			modal: true,
			width: 650,
			resizable: false,
			closeOnEscape: true,
			show: "blind",
			hide: "blind",
			buttons: {
				Close: function() {
					$(this).dialog('close');
				}
			}
		});
	});

</script>

</body>
</html>
<?php
function cmp_order($a, $b) {
	$al = strtolower ( $a->order );
	$bl = strtolower ( $b->order );
	if ($al == $bl) {
		return 0;
	}
	return ($al > $bl) ? + 1 : - 1;
}

?>